<?php 
$tabla="noticias";
$condicion=" NoticiaPublicar=1 and NoticiaDestacada=1";
$orden=" order by NoticiaFecha desc";
$res=cons_sql($tabla,$condicion,$orden);
$a=1;
if(mysql_num_rows($res)>0):
 $cant=mysql_num_rows($res);
?>
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
  <?php for($i=0;$i<$cant;$i++):
   if($i==1)
     $class='class="active"';
	 else
	  $class='';
  ?>
    <li data-target="#carousel-example-generic" data-slide-to="<?php echo $i ?>" <?php echo $class ?>></li>
	<?php endfor ?>	
    </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner">
  	<?php while($reg=mysql_fetch_array($res)):
	  if($a==1)
	   $class='class="item active"';
	   else 
	   $class='class="item"';
	   $a++;
	?>
    <div <?php echo $class ?>>
      <img src="<?php echo RUTAPANEL.$reg['NoticiaImagen']?>" alt="<?php echo utf8_encode($reg['novTitulo'])?>"  class="img-responsive" >
      <div class="carousel-caption">
       <span class="fec">
	   <?php echo format_fec_age($reg['NoticiaFecha'])?></span> 
	   <a href="noticia.php?not=<?php echo utf8_encode($reg['NoticiaId'])?>"><?php echo utf8_encode($reg['NoticiaTitulo'])?></a>
      </div>
    </div>
   <?php endwhile?>	
 </div>
    

  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left"></span>
  </a>
  <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right"></span>
  </a>
</div>
</div>

</div>
</div>
<?php endif ?>	